﻿<Window x:Class="Adan.Client.Dialogs.ProfilesChooseDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Utils="clr-namespace:Adan.Client.Common.Utils;assembly=Adan.Client.Common"
        Title="Profiles" 
        ResizeMode="NoResize" 
        ShowInTaskbar="False" 
        WindowStartupLocation="CenterOwner" 
        WindowStyle="ToolWindow" 
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        Width="300"
        Height="300"
        Name="ProfilesChooseWindow"
        Style="{StaticResource DefaultWindowStyle}">
    <Window.Resources>
        <Utils:InverseBooleanConverter x:Key="InverseBooleanConverter" />
    </Window.Resources>
    <Grid Margin="1">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ListBox Grid.Row="0" Margin="0,0,0,5" ItemsSource="{Binding Path=Profiles}" SelectedValue="{Binding Path=SelectedProfile}" Name="lstProfiles">
            <ListBox.Resources>
                <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                    <EventSetter Event="MouseDoubleClick" Handler="HandleItemDoubleClick"/>
                </Style>
            </ListBox.Resources>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid HorizontalAlignment="Stretch" Background="Transparent">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding Path=NameProfile}" Margin="10,0,0,3" VerticalAlignment="Center" Grid.Column="0"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Click="HandleOkClick" Margin="0,0,5,0" HorizontalAlignment="Right" IsDefault="True" MinWidth="50" Content="Ok"/>
            <Button HorizontalAlignment="Right" Grid.Row="2" IsDefault="True" IsCancel="True" MinWidth="50">Close</Button>
        </StackPanel>
    </Grid>
</Window>
